# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=amber
_pkgname=Amber
pkgver=0.3.3
_pkgver=$pkgver-alpha # upstream releases versions suffixed by -alpha for now
pkgrel=0
pkgdesc="Programming language compiled to bash"
url="https://amber-lang.com"
arch="all"
license="GPL-3.0-or-later"
depends="bc bash"
makedepends="cargo cargo-auditable"
source="$pkgname-$pkgver.tar.gz::https://github.com/Ph0enixKM/Amber/archive/refs/tags/$_pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$_pkgver"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/amber -t "$pkgdir"/usr/bin
}

sha512sums="
7b9b519aba3cab95660c3f3b699bb2b1ee9a35ec61833655a7f395666323bec0bfc6e60dfdc4b11b203a36bc3ba025454df399f0cfb96c6250a471b9591ab4f2  amber-0.3.3.tar.gz
"
